<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <?=$opt_gc?>
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/setcolor.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
</head>
<body id="index_setting">
    <span class="layui-breadcrumb" >
        <a ><cite><i class="fa fa-map-marker"></i>位置</cite></a>
        <a href="<?=site_url('news/admin/news')?>">新闻</a>
        <a href="<?=site_url('news/admin/news')?>">新闻管理</a>
        <a href=""><?=$title2?></a>
    </span>
    <div class="layui-tab layui-tab-brief" >
        <ul class="layui-tab-title">
            <li><a class="tablink" href="<?=site_url('news/admin/news')?>">新闻列表</a></li>
            <li ><a class="tablink" href="<?=site_url('news/admin/news')?>?yid=2">待审核新闻</a></li>
            <li ><a class="tablink" href="<?=site_url('news/admin/news')?>?yid=3">回收站新闻</a></li>
            <li class="layui-this"><a class="tablink" href="<?=site_url('news/admin/news/edit')?>">增加新闻</a></li>
        </ul>
        <div class="layui-tab-content" style="min-height: 360px;">
            <form class="layui-form layui-form-pane" action="<?=site_url('news/admin/news/save')?>" method="post">
            <div class="layui-tab">
                <ul class="layui-tab-title">
                    <li class="layui-this">基本参数</li>
                    <li>其他参数</li>
                    <li>内容/SEO</li>
                    <li>自定义字段</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label">新闻参数</label>
                            <div class="layui-input-inline layui-input-inlinew marg10">
                                <select name="cid">
                                    <option value="0">请选择分类</option>
                                    <?php
                                        $query = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."news_list where fid=0 order by xid asc"); 
                                        foreach ($query->result() as $row) {
                                            $clas=($row->id==$cid)?' selected="selected"':'';
                                            echo '<option value="'.$row->id.'"'.$clas.'>'.$row->name.'</option>';
                                            $query2 = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."news_list where fid=".$row->id." order by xid asc"); 
                                            foreach ($query2->result() as $row2) {
                                                $clas2=($row2->id==$cid)?' selected="selected"':'';
                                                echo '<option value="'.$row2->id.'"'.$clas2.'>'.$row2->name.'</option>';
                                            }
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-input-inlinew">
                                <select name="tid">
                                    <option value="0">新闻专题</option>
                                    <?php
                                        $query = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."news_topic order by id asc"); 
                                        foreach ($query->result() as $row) {
                                            $clas=($row->id==$tid)?' selected="selected"':'';
                                            echo '<option value="'.$row->id.'"'.$clas.'>'.$row->name.'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-input-inlinew" >
                                <select name="reco">
                                    <option value="0"<?php if($reco==0) echo ' selected';?>>新闻推荐</option>
                                    <option value="1"<?php if($reco=='1') echo ' selected';?>>★☆☆☆☆</option>
                                    <option value="2"<?php if($reco=='2') echo ' selected';?>>★★☆☆☆</option>
                                    <option value="3"<?php if($reco=='3') echo ' selected';?>>★★★☆☆</option>
                                    <option value="4"<?php if($reco=='4') echo ' selected';?>>★★★★☆</option>
                                    <option value="5"<?php if($reco=='5') echo ' selected';?>>★★★★★</option>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-input-inlinew" >
                                <input class="layui-input" name="color" id="color" type="text" value="<?=$color?>"/>
                                <img src="<?=Web_Path?>packs/admin/images/rect.gif" width="18" height="17" border=0 style="position:absolute;right: 5px;top:9px;cursor:pointer;background-Color:<?=$color?>;" title="字体颜色" onClick="initcolor('color','imgs_color');" id="imgs_color" align="absmiddle" vspace="1">
                            </div>
                            <div class="layui-form-mid layui-word-aux">名称颜色</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新闻标题</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" placeholder="请输入新闻名称" value="<?=$name?>" class="layui-input">
                            </div>
                            <div class="layui-input-inline">
                                <input type="checkbox" name="addtime" lay-skin="primary" value="ok" title="更新时间" checked>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新闻描述</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info" placeholder="128个字以内" value="<?=$info?>" class="layui-input">
                            </div>
                        </div>
                        
                        <div class="layui-form-item">
                            <label class="layui-form-label">新闻图片</label>
                            <div class="layui-input-inline" >
                                <input id="pic" type="text" name="pic" value="<?=$pic?>" class="layui-input">
                            </div>
                            
                            <?php 
                                if(preg_match("/(iPhone|iPad|iPod|Android)/i", strtoupper($_SERVER['HTTP_USER_AGENT']))){
                                    echo '<button type="button" class="layui-btn layui-btn-primary" id="pics"><i class="layui-icon colorb">&#xe608;</i>上传图片</button>';
                                }else{
                                    echo '<div class="layui-input-inline" style="width: auto;"><a href="javascript:cscms.get_open(\''.site_url('upload/up').'?dir=news\',\'上传图片\',\'500px\',\'360px\')" class="layui-btn layui-btn-primary"><i class="layui-icon" style="color:green">&#xe608;</i>上传图片</a></div>';
                                }
                            ?>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">幻灯图片</label>
                            <div class="layui-input-inline" >
                                <input id="pic2" type="text" name="pic2" value="<?=$pic2?>" class="layui-input">
                            </div>
                            
                            <?php 
                                if(preg_match("/(iPhone|iPad|iPod|Android)/i", strtoupper($_SERVER['HTTP_USER_AGENT']))){
                                    echo '<button type="button" class="layui-btn layui-btn-primary" id="huand"><i class="layui-icon colorb">&#xe608;</i>上传图片</button>';
                                }else{
                                    echo '<div class="layui-input-inline" style="width: auto;"><a href="javascript:cscms.get_open(\''.site_url('upload/up').'?dir=news&fid=2\',\'上传幻灯图片图片\',\'500px\',\'360px\')" class="layui-btn layui-btn-primary"><i class="layui-icon" style="color:green">&#xe608;</i>上传图片</a></div>';
                                }
                            ?>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">TAGS标签</label>
                            <div class="layui-input-inline">
                                <input type="text" name="tags" placeholder="多个逗号隔开" value="<?=$tags?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">访问人气</label>
                            <label class="layui-form-label label2 marg10">总</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="hits" value="<?=$hits?>" class="layui-input">
                            </div>
                            <label class="layui-form-label label2 marg10">月</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="yhits" value="<?=$yhits?>" class="layui-input">
                            </div>
                            <label class="layui-form-label label2 marg10">周</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="zhits" value="<?=$zhits?>" class="layui-input">
                            </div>
                            <label class="layui-form-label label2 marg10">日</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="rhits" value="<?=$rhits?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">其他人气</label>
                            <label class="layui-form-label label2 marg10">顶</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="dhits" value="<?=$dhits?>" class="layui-input">
                            </div>
                            <label class="layui-form-label label2 marg10">踩</label>
                            <div class="layui-input-inline layui-input-inlinehot">
                                <input type="text" name="chits" value="<?=$chits?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">会员参数</label>
                            <div class="layui-input-inline layui-input-inlinew marg10">
                                <input type="text" name="user" placeholder="会员名称" value="<?=getzd('user','name',$uid)?>" class="layui-input">
                            </div>
                            <label class="layui-form-label label2">金币</label>
                            <div class="layui-input-inline layui-input-inlinew" >
                                <input type="text" name="cion" value="<?=$cion?>" placeholder="下载所需金币" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-input-inlinew">
                                <select name="vip">
                                    <option value="0">会员组权限</option>
                                    <?php
                                        $query = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."userzu order by id asc"); 
                                        foreach ($query->result() as $row) {
                                            $clas=($row->id==$vip)?' selected="selected"':'';
                                            echo '<option value="'.$row->id.'"'.$clas.'>'.$row->name.'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-input-inlinew" >
                                <select name="level">
                                    <option value="0">会员等级权限</option>
                                    <?php
                                        $query = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."userlevel order by id asc"); 
                                        foreach ($query->result() as $row) {
                                            $clas=($row->id==$level)?' selected="selected"':'';
                                            echo '<option value="'.$row->id.'"'.$clas.'>'.$row->name.'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">默认模版</label>
                            <div class="layui-input-inline">
                                <input type="text" name="skins" value="<?=$skins?>" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">默认为show.html</div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item layui-form-text" >
                            <label class="layui-form-label">
								新闻内容
								<font style="float:right;font-weight:bold;color:red;">内容分页标签：[cscms:page]</font>
							</label>
                            <div class="layui-input-block">
                                <textarea id="text" lay-verify="content" name="content" placeholder="" class="layui-textarea"><?=$content?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO设置</label>
                            <div class="layui-input-inline">
                                <a class="layui-btn layui-btn-small" style="margin: 4px 10px;" href="javascript:$('#seo').toggle();">点击展开/合并SEO设置</a>
                            </div>
                        </div>
                        <div id="seo" style="display: none;">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">SEO标题</label>
                            <div class="layui-input-block">
                                <textarea name="title" style="height: 100px" class="layui-textarea"><?=$title?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">SEO关键字</label>
                            <div class="layui-input-block">
                                <textarea name="keywords" style="height: 100px" class="layui-textarea"><?=$keywords?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">SEO介绍</label>
                            <div class="layui-input-block">
                                <textarea name="description" style="height: 100px" class="layui-textarea"><?=$description?></textarea>
                            </div>
                        </div></div>
                    </div>
                    <div class="layui-tab-item"><?=$opt_field?></div>
                </div>
            </div>
                <input type="hidden" name="id" value="<?=$id?>">
                <input type="hidden" name="yid" value="<?=$yid?>">
                <div class="layui-form-item">
                    <div class="layui-input-block layui-input-common noborder">
                        <button class="layui-btn" lay-submit lay-filter="setting">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script type="text/javascript">
        cscms.init(5);
        cscms.mode('cscms.getUpload(\'<?=Web_Path.SELF?>/upload/up_save_json?dir=news\')');
        cscms.mode('cscms.getUpload(\'<?=Web_Path.SELF?>/upload/up_save_json?dir=news&fid=2\',\'pic2\',\'huand\')');
    </script>
</body>
</html>